package com.feihao.demo01DateJDK8;

import java.time.DayOfWeek;
import java.time.LocalDateTime;
import java.time.Month;

public class Demo02DateJDK8 {
    public static void main(String[] args) {
        LocalDateTime localDateTime = LocalDateTime.now();

        //获取当前系统时间的年份：
        int year = localDateTime.getYear();
        ///获取当前系统时间的月份：
        Month month = localDateTime.getMonth();
        int monthValue = localDateTime.getMonthValue();


        //获取当前系统时间月分中第几天：
        int dayOfMonth = localDateTime.getDayOfMonth();

        //获取当前系统时间年分中第几天：
        int dayOfYear = localDateTime.getDayOfYear();
        System.out.println("年中的第几天"+dayOfYear);

        //获取星期：
        DayOfWeek dayOfWeek = localDateTime.getDayOfWeek();
        System.out.println(dayOfWeek);
    }
}
